home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-10-20 | 601 b | 39 lines | [TEXT/CWIE] |
- #include <iostream.h>
-
-
- //--------------------------------------- Blob
-
- class Blob
- {
- public:
- void *operator new( size_t blobSize );
- void operator delete( void *blobPtr, size_t blobSize );
- };
-
- void *Blob::operator new( size_t blobSize )
- {
- cout << "new: " << blobSize << " byte(s).\n";
-
- return new char[ blobSize ];
- }
-
- void Blob::operator delete( void *blobPtr, size_t blobSize )
- {
- cout << "delete: " << blobSize << " byte(s).\n";
-
- delete [] blobPtr;
- }
-
-
- //--------------------------------------- main()
-
- int main()
- {
- Blob *blobPtr;
-
- blobPtr = new Blob;
-
- delete blobPtr;
-
- return 0;
- }